//
//  PreferActivityCell.m
//  Socrates
//
//  Created by shy on 15/4/6.
//  Copyright (c) 2015年 shy. All rights reserved.
//

#import "PreferActivityCell.h"

@interface PreferActivityCell () {
    UIView *downView_;
}

@end

@implementation PreferActivityCell
- (void)awakeFromNib {
    [self configUpView];
    [self configDownView];
    [self addSubview:downView_];
}

- (void)configUpView {
    CGFloat width = [UIScreen mainScreen].bounds.size.width;
    CGFloat topEdge = 5;
    CGFloat LeftRightEdge = 15.;
    CGSize activityBackgroundImageSize = CGSizeMake(width - LeftRightEdge*2, 180.);
    self.activityBackgroundImage = [[UIImageView alloc] initWithFrame:CGRectMake(LeftRightEdge, topEdge, activityBackgroundImageSize.width, activityBackgroundImageSize.height)];
    self.activityBackgroundImage.image = [UIImage imageNamed:@"prefer_test_shop"];
    [self addSubview:self.activityBackgroundImage];
    
}

- (void)configDownView {
    CGFloat width = [UIScreen mainScreen].bounds.size.width;
    CGFloat leftEdge = 15;
    CGSize downViewSize = CGSizeMake(width - leftEdge *2, 40.);
    downView_ = [[UIView alloc] initWithFrame:CGRectMake(leftEdge, 145, downViewSize.width, downViewSize.height)];
    downView_.backgroundColor = [UIColor colorWithRed:0/255. green:0/255. blue:0/255. alpha:0.2];
    
    self.activityName = [[UILabel alloc] initWithFrame:CGRectMake(0, 11., 0.53*width, 18.)];
    self.activityName.textColor = [UIColor whiteColor];
    self.activityName.font = [UIFont systemFontOfSize:16.];
    [downView_ addSubview:self.activityName];
    
    self.activityTime = [[UILabel alloc] initWithFrame:CGRectMake(downViewSize.width - 35 - 70, 8, 70, 13.)];
    self.activityTime.textColor = [UIColor whiteColor];
    self.activityTime.font = [UIFont systemFontOfSize:11];
    [downView_ addSubview:self.activityTime];
    
    self.activityLocation = [[UILabel alloc] initWithFrame:CGRectMake(downViewSize.width - 35 - 70, 20, 70, 15)];
    self.activityLocation.textColor = [UIColor whiteColor];
    self.activityLocation.font = [UIFont systemFontOfSize:11.];
    [downView_ addSubview:self.activityLocation];
    
    UIImageView *likeImage = [[UIImageView alloc] initWithFrame:CGRectMake(downViewSize.width - 35, 5, 20., 17.)];
    likeImage.image = [UIImage imageNamed:@"home_like"];
    [downView_ addSubview:likeImage];
    
    self.likes = [[UILabel alloc] initWithFrame:CGRectMake(downViewSize.width - 35, 23., 22, 15.)];
    self.likes.font = [UIFont systemFontOfSize:12.];
    self.likes.textColor = [UIColor whiteColor];
    self.likes.textAlignment = NSTextAlignmentCenter;
    [downView_ addSubview:self.likes];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}

@end
